﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SystemOperations.cs" company="dimamartovoi">
//   Apache License
//   Version 2.0, January 2004
//   http://www.apache.org/licenses
// </copyright>
// <summary>
//   The system operations.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.Collections.Generic;
using System.Linq;

namespace ActorModel.Evolution.Operations
{
    /// <summary>
    ///     The system operations.
    /// </summary>
    public static class SystemOperations
    {
        #region Public Methods and Operators

        /// <summary>
        /// The init states.
        /// </summary>
        /// <param name="states">
        /// The states.
        /// </param>
        public static void InitStates(string[] states)
        {
            for (int i = 0; i < states.Length; i++)
            {
                if (string.IsNullOrEmpty(states[i]))
                {
                    states[i] = "0";
                }
            }
        }

        /// <summary>
        /// The result states count.
        /// </summary>
        /// <param name="states">
        /// The states.
        /// </param>
        /// <returns>
        /// The <see cref="int"/>.
        /// </returns>
        public static int ResultStatesCount(IEnumerable<string> states)
        {
            return states.Count() + 1;
        }

        #endregion
    }
}